home *** CD-ROM | disk | FTP | other *** search
- /* arexx Script
- SAVE Anim in GIF format
- need in 'PerfectPaint/tools':
- - tapgif
- - WhirlGif
- */
-
- options results
- parse ARG Port b
-
- ADDRESS value Port
- options results
-
- pp_CountFrames
- nb=result
- if nb<2 then do
- pp_Warn 'Make*an*Anim*first.'
- EXIT
- end
-
- file=""
- file2=""
- option=0
- option2=0
- if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/SaveAnimGif') THEN DO
- IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/SaveAnimGif', "R") then DO
- file = READLN('lfile')
- option=READLN('lfile')
- option2=READLN('lfile')
- CALL CLOSE('lfile')
- file2=""
- do i=1 to LENGTH(file)
- a=SUBSTR(file,i,1)
- if a=" " then DO
- a="*"
- END
- file2=file2||a
- END
- file=file2
- END
- END
-
- pp_GetDepth
- D=result
- IF D=24 then DO
- pp_RenderReq 1
- END
-
- pp_DialogInit 250 100 "*Save*AnimGif*" 4
- pp_String 0 55 8 150 16 "Name" 1 100 file
-
- n=LASTPOS('/',file)
- if n=0 then DO
- n=LASTPOS(':',file)
- file=SUBSTR(file,1,n)
- END
- else DO
- file=SUBSTR(file,1,n)
- END
-
- pp_Getfile 1 210 9 0 "Save*AnimGif" 0 file
- pp_Cycle 2 105 28 100 16 "Transparency" 1 "No|Color*0|Current*Bg" option
- pp_Cycle 3 105 48 100 16 "Disposal*method" 1 "None|Not|Background|Previous" option2
- pp_Dialog
-
- rc=result
- if rc=0 then
- do
- EXIT
- end
-
- pp_GetDialog 0
- file=result
- IF file="" then DO
- EXIT
- END
-
- file2='PerfectPaint:temp/temp'
-
- pp_GetDialog 2
- option=result
-
- pp_GetDialog 3
- option2=result
-
- CALL SavePrefs('SaveAnimGif',file,option,option2)
- ADDRESS value Port
-
- if option2=0 then
- DO
- dispose='none'
- END
-
- if option2=1 then
- DO
- dispose='not'
- END
-
- if option2=2 then
- DO
- dispose='back'
- END
-
- if option2=3 then
- DO
- dispose='prev'
- END
-
- if option=2 then
- DO
- pp_GetBpen
- Bpen=result
- END
-
- if option=1 then
- DO
- Bpen=0
- END
-
- pp_GotoFrame 1
- pp_GetJiffies
- jiffies=result*2
- filetemp="ram:temp"
-
- ii=''
- IF D=24 then DO
- pp_Render 2 'PerfectPaint:Temp/temp'
- CALL OPEN(out,filetemp,write)
- pp_asay 'Making*GIF*picture|Please*wait*...'
- Do i=1 to nb
- ii=i
- IF i<100 then DO
- ii='0'||i
- IF i<10 then DO
- ii='00'||i
- END
- END
- address COMMAND
- 'perfectpaint:tools/tapgif '||'PerfectPaint:Temp/temp'||ii||' '||'PerfectPaint:Temp/temp.'||ii
- CALL WRITELN(out,'PerfectPaint:Temp/temp.'||ii)
- END
- ADDRESS value Port
- pp_CloseAsay
- END
-
- IF D<24 then DO
- pp_asay 'Saving*GIF*file|Please*wait*...'
- CALL OPEN(out,filetemp,write)
- DO i=1 to nb
- pp_GotoFrame i
- pp_save 'ram:t/pptemp' 0
- file3=file2||i
- address COMMAND
- 'perfectpaint:tools/tapgif '||'ram:t/pptemp '||'"'||file3||'"'
- 'delete >nil: ram:t/pptemp'
- CALL WRITELN(out,file3)
- ADDRESS value Port
- END
- pp_CloseAsay
- END
-
- pp_asay 'Making*Animation|Please*wait*...'
-
- address COMMAND
- CALL CLOSE(out)
-
- if option=0 then
- DO
- 'perfectpaint:tools/WhirlGif -time '||jiffies||' -o '||'"'||file||'"'||' -loop '||'-disp '||dispose||' -i ram:temp'
- END
- ELSE
- DO
- 'perfectpaint:tools/WhirlGif -time '||jiffies||' -o '||'"'||file||'"'||' -loop -trans '||Bpen||' -disp '||dispose||' -i ram:temp'
- END
- 'delete >nil: PerfectPaint:Temp/?#.*'
-
- ADDRESS value Port
- pp_CloseAsay
-
- address COMMAND
- 'delete >nil: ram:temp'
-
- EXIT
-
-
-
- SavePrefs: PROCEDURE
-
- Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
-
- if EXISTS(Prefname) THEN DO
- ADDRESS COMMAND
- 'delete >nil: '||Prefname
- END
-
- IF OPEN('pfile',PrefName,'W') THEN DO
-
- do i=2 to ARG()
- CALL WRITELN('pfile',ARG(i))
- end
-
- CALL CLOSE('pfile')
-
- RETURN